package com.nuoniu.sibanyun.entity.po;

import com.baomidou.mybatisplus.annotation.FieldStrategy;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableName;
import com.fasterxml.jackson.annotation.JsonFormat;
import com.nuoniu.sibanyun.common.BaseEntity;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import io.swagger.models.auth.In;
import lombok.Data;
import lombok.EqualsAndHashCode;
import lombok.experimental.Accessors;

import java.math.BigDecimal;
import java.time.LocalDate;
import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 * 采购到货单主表
 * </p>
 *
 * @author 小啊刚
 * @since 2020-11-19
 */
@Data
@EqualsAndHashCode(callSuper = true)
@Accessors(chain = true)
@TableName("scp_receiving")
@ApiModel(value="VPurchaseArrivalMain对象", description="采购到货单主表")
public class VPurchaseArrivalMain extends BaseEntity {

    private static final long serialVersionUID = 1L;

    @ApiModelProperty(value = "公司id")
    @TableField("company_id")
    private Integer companyId;

    @ApiModelProperty(value = "账套id")
    @TableField("account_id")
    private Integer accountId;

    @ApiModelProperty(value = "数据来源")
    @TableField("data_source")
    private String dataSource;

    @ApiModelProperty(value = "单据编号")
    @TableField("voucher_code")
    private String voucherCode;

    @ApiModelProperty(value = "单据日期")
    @TableField("voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate voucherDate;

    @ApiModelProperty(value = "供应商id")
    @TableField("vendor_id")
    private Integer vendorId;

    @ApiModelProperty(value = "供应商名称")
    @TableField("vendor_name")
    private String vendorName;

    @ApiModelProperty(value = "供应商简称")
    @TableField("vendor_simple_name")
    private String vendorSimpleName;

    @ApiModelProperty(value = "部门id")
    @TableField("office_id")
    private Integer officeId;

    @ApiModelProperty(value = "部门名称")
    @TableField("office_name")
    private String officeName;

    @ApiModelProperty(value = "部门编码")
    @TableField("office_code")
    private String officeCode;

    @ApiModelProperty(value = "业务员ID")
    @TableField("salesman_id")
    private Integer salesmanId;

    @ApiModelProperty(value = "业务员")
    @TableField("salesman_name")
    private String salesmanName;

    @ApiModelProperty(value = "仓库ID")
    @TableField("warehouse_id")
    private Integer warehouseId;

    @ApiModelProperty(value = "仓库名称")
    @TableField("warehouse_name")
    private String warehouseName;

    @ApiModelProperty(value = "仓库编码")
    @TableField("warehouse_code")
    private String warehouseCode;

    @ApiModelProperty(value = "状态")
    @TableField("voucher_state")
    private Integer voucherState;

    @ApiModelProperty(value = "制单人ID")
    @TableField("create_user_id")
    private Integer createUserId;

    @ApiModelProperty(value = "创建人")
    @TableField("create_user_name")
    private String createUserName;

    @ApiModelProperty(value = "制单时间")
    @TableField("create_date")
    private LocalDateTime createDate;

    @ApiModelProperty(value = "修改人ID")
    @TableField("update_user_id")
    private Integer updateUserId;

    @ApiModelProperty(value = "修改人")
    @TableField("update_user_name")
    private String updateUserName;

    @ApiModelProperty(value = "审核人ID")
    @TableField("reviewer_user_id")
    private Integer reviewerUserId;

    @ApiModelProperty(value = "审核人姓名")
    @TableField("reviewer_user_name")
    private String reviewerUserName;

    @ApiModelProperty(value = "审核时间")
    @TableField("reviewer_date")
    private LocalDateTime reviewerDate;

    @ApiModelProperty(value = "备注")
    @TableField("remarks")
    private String remarks;



    @ApiModelProperty(value = "变更时间")
    @TableField("update_date")
    private LocalDateTime updateDate;

    @ApiModelProperty(value = "营销机构")
    @TableField("marketing_organ")
    private String marketingOrgan;

    @ApiModelProperty(value = "打印次数")
    @TableField("print_count")
    private Integer printCount;

    @ApiModelProperty(value = "关闭人")
    @TableField("closed_user_id")
    private Integer closedUserId;

    @ApiModelProperty(value = "关闭人姓名")
    @TableField("closed_user_name")
    private String closedUserName;

    @ApiModelProperty(value = "关闭日期")
    @TableField("closed_date")
    private LocalDateTime closedDate;

    @ApiModelProperty(value = "提交人ID")
    @TableField("submit_user_id")
    private Integer submitUserId;

    @ApiModelProperty(value = "提交人姓名")
    @TableField("submit_user_name")
    private String submitUserName;

    @ApiModelProperty(value = "提交时间")
    @TableField("submit_date")
    private LocalDateTime submitDate;

    @ApiModelProperty(value = "币种ID")
    @TableField("currency_id")
    private Integer currencyId;

    @ApiModelProperty(value = "币种")
    @TableField("currency_name")
    private String currencyName;

    @ApiModelProperty(value = "支付方式")
    @TableField("pay_type")
    private String payType;

    @ApiModelProperty(value = "到货地址")
    @TableField("accept_address")
    private String acceptAddress;

    @ApiModelProperty(value = "合同")
    @TableField("contract_id")
    private Integer contractId;

    @ApiModelProperty(value = "发运方式ID")
    @TableField("despatch_type_id")
    private Integer despatchTypeId;

    @ApiModelProperty(value = "发运方式名称")
    @TableField("despatch_type_name")
    private String despatchTypeName;

    @ApiModelProperty(value = "预计到货日期")
    @TableField("accept_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate acceptDate;

    @ApiModelProperty(value = "汇率")
    @TableField("exchange_rate")
    private BigDecimal exchangeRate;

    @ApiModelProperty(value = "订金金额")
    @TableField("orig_earnest_money")
    private BigDecimal origEarnestMoney;

    @ApiModelProperty(value = "联系人")
    @TableField("link_man_id")
    private Integer linkManId;

    @ApiModelProperty(value = "联系人名称")
    @TableField("link_man_name")
    private String linkManName;

    @ApiModelProperty(value = "联系电话")
    @TableField("link_tel_phone")
    private String linkTelPhone;

    @ApiModelProperty(value = "项目id")
    @TableField("project_id")
    private Integer projectId;

    @ApiModelProperty(value = "项目名称")
    @TableField("project_name")
    private String projectName;

    @ApiModelProperty(value = "项目编码")
    @TableField("project_code")
    private String projectCode;

    @ApiModelProperty(value = "来源单id")
    @TableField("source_voucher_id")
    private Integer sourceVoucherId;

    @ApiModelProperty(value = "来源单号")
    @TableField("source_voucher_code")
    private String sourceVoucherCode;

    @ApiModelProperty(value = "来源日期")
    @TableField("source_voucher_date")
    @JsonFormat(shape = JsonFormat.Shape.STRING, pattern = "yyyy-MM-dd" )
    private LocalDate sourceVoucherDate;

    @ApiModelProperty(value = "来源单据")
    @TableField("source_voucher_type")
    private String sourceVoucherType;

    @ApiModelProperty(value = "金额")
    @TableField("total_amount")
    private BigDecimal totalAmount;

    @ApiModelProperty(value = "税额")
    @TableField("total_tax_amount")
    private BigDecimal totalTaxAmount;

    @ApiModelProperty(value = "含税金额")
    @TableField("total_include_tax_amount")
    private BigDecimal totalIncludeTaxAmount;

    @ApiModelProperty(value = "外币含税金额")
    @TableField("foreign_total_tax_amount")
    private BigDecimal foreignTotalTaxAmount;

    @ApiModelProperty(value = "外币订金金额")
    @TableField("foreign_earnest_money")
    private BigDecimal foreignEarnestMoney;

    @ApiModelProperty(value = "外币金额")
    @TableField("foreign_total_amount")
    private BigDecimal foreignTotalAmount;

    @ApiModelProperty(value = "自定义字段数据")
    @TableField("define_fields")
    private String defineFields;

    @ApiModelProperty(value = "业务类型")
    @TableField("business_type")
    private Integer businessType;

    @ApiModelProperty(value = "入库状态 0：否 1：是")
    @TableField("in_stock_state")
    private Integer inStockState;

//    @ApiModelProperty(value = "票据类型")
//    @TableField("invoice_type")
//    private String invoiceType;

    @ApiModelProperty(value = "发票类型ID")
    @TableField("invoice_type_id")
    private Integer invoiceTypeId;

    @ApiModelProperty(value = "发票类型名称")
    @TableField("invoice_type_name")
    private String invoiceTypeName;

    @ApiModelProperty(value = "发票类型CODE")
    @TableField("invoice_type_code")
    private String invoiceTypeCode;


    @ApiModelProperty(value = "发票号")
    @TableField("purchaseInvoice_no")
    private String purchaseinvoiceNo;




    @ApiModelProperty(value = "结算标识")
    @TableField("is_settlement")
    private Boolean isSettlement;

    @ApiModelProperty(value = "是否负发票")
    @TableField("is_negative")
    private Integer isNegative;

    @ApiModelProperty(value = "采购类型ID")
    @TableField("purchase_type_id")
    private Integer purchaseTypeId;

    @ApiModelProperty(value = "采购类型名称")
    @TableField("purchase_type_name")
    private String purchaseTypeName;

    @ApiModelProperty(value = "采购类型编码")
    @TableField("purchase_type_code")
    private String purchaseTypeCode;

    @ApiModelProperty(value = "收发类别ID")
    @TableField("rd_style_id")
    private Integer rdStyleId;

    @ApiModelProperty(value = "收发类别")
    @TableField("rd_style_name")
    private String rdStyleName;

    @ApiModelProperty(value = "收发类别编码")
    @TableField("rd_style_code")
    private String rdStyleCode;

    @ApiModelProperty(value = "税率")
    @TableField("tax_rate")
    private BigDecimal taxRate;

    @ApiModelProperty(value = "总数量")
    @TableField("total_quantity")
    private BigDecimal totalQuantity;

    @ApiModelProperty(value = "累计执行数量")
    @TableField("cum_execute_quantity")
    private BigDecimal cumExecuteQuantity;

    @ApiModelProperty(value = "累计退货数量（普通退货）")
    @TableField("cum_ret_quantity")
    private BigDecimal cumRetQuantity;



    @ApiModelProperty(value = "采购到货单明细")
    @TableField(exist = false)
    private List<VPurchaseArrivalDetail> orderDetailList;

    @ApiModelProperty(value = "需要删除的明细id")
    @TableField(exist = false)
    private List<Integer> removeIds;

}
